<template>
  <div class="shop-car-nav">
    <div class="choose-all" @click="tabChoseAll">
      <img src="~assets/img/common/goodChoose.svg" alt="" :class="{isChecked: this.$store.state.isChooseAll}">
      <span>全选</span>
    </div>
    <div class="settlement">
      <span>合计: {{this.$store.getters.getGoodsTotalPrice.toFixed(2)}}</span>
      <button>结算</button>
    </div>
  </div>
</template>

<script>
export default {
  name: "ShopCarNav",
  methods: {
    tabChoseAll() {
      this.$store.commit('tabGoodsChoseAll');
    }
  }
}
</script>

<style scoped lang="less">
  .shop-car-nav {
    display: flex;
    height: 60px;
    padding: 0 10px;
    background-color: #ffffff;
    color: #000000;
  }

  .choose-all {
    flex: 40%;
    height: 100%;
    line-height: 60px;
    .isChecked {
      background-color: var(--color-high-text);
      border: none;
    }
    img {
      width: 24px;
      height: 24px;
      padding: 4px;
      margin-right: 4px;
      border-radius: 12px;
      vertical-align: middle;
      border: 2px solid #cccccc;
    }
  }

  .settlement {
    flex: 60%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    span {
      margin-right: 10px;
    }
    button {
      width: 48%;
      height: 70%;
      border: none;
      color: #ffffff;
      border-radius: 24px;
      background-color: var(--color-tint);
    }
  }
</style>